﻿using System.Collections.Generic;
using Engine;
using Game;
using static Mekiasm.MekCraftingRecipe;
namespace Mekiasm
{
    public class Hohlraum : ItemFlat
    {
        public static int Index;

        public Hohlraum() : base( "陨石信号发生器", MekiasmInit.GetFlatTexture(MekiasmInit.R1, "Hohlraum"))
        {
            
        }
        public override bool OnUse(Ray3 aim, ComponentMiner componentMiner, TerrainRaycastResult? raycast)
        {
            return false;
        }
        public override bool IsPlaceable_(int value)
        {
            return true;
        }
        public override void OnBlockAdded(SubsystemBlockBehavior blockBehavior, int value, int oldValue, int x, int y, int z)
        {
            LightSystem.MakePoints.Add(new Point3(x, y, z));
        }
        public override void OnBlockRemoved(SubsystemBlockBehavior blockBehavior, int value, int newValue, int x, int y, int z)
        {
            LightSystem.MakePoints.Remove(new Point3(x, y, z));
        }
        public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List<BlockDropValue> dropValues, out bool showDebris)
        {
            showDebris = true;
            dropValues.Add(new BlockDropValue() { Value = ILibrary.GetBasicValue(0), Count = 1 });
        }
        public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value)
        {
            return true;
        }
        public override void GenerateTerrainVertices(Block block, BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            generator.GenerateCrossfaceVertices(block, value, x, y, z, Color.White, 0, geometry.GetGeometry(texture2D).SubsetOpaque);
        }

    }
}
